package com.timi_licai.timi_licai_account;

import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;


public class LoadActivity extends ActionBarActivity implements View.OnClickListener {

    private EditText editAccount;
    private EditText editPassword;

    @Override
    protected void onCreate (Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_load);

        ImageView imgBack = (ImageView)findViewById(R.id.load_back_btn);
        TextView txtFreeRegister = (TextView)findViewById(R.id.load_free_register);
        TextView txtLogin = (TextView)findViewById(R.id.load_login_btn);
        TextView txtForgetPassword = (TextView)findViewById(R.id.load_forget_password);
        editAccount = (EditText)findViewById(R.id.load_account_edit);
        editPassword = (EditText)findViewById(R.id.load_password_edit);
        ImageView imgWeixin = (ImageView)findViewById(R.id.load_etc_login_weixin);
        ImageView imgQQ = (ImageView)findViewById(R.id.load_etc_login_qq);
        ImageView imgSina = (ImageView)findViewById(R.id.load_etc_login_sina);

        if (imgBack != null) {
            imgBack.setOnClickListener(this);
        }
        if (txtLogin!=null){
            txtLogin.setOnClickListener(this);
        }
        if (txtForgetPassword != null) {
            txtForgetPassword.setOnClickListener(this);
        }
        if (imgWeixin != null) {
            imgWeixin.setOnClickListener(this);
        }
        if (imgQQ != null) {
            imgQQ.setOnClickListener(this);
        }
        if (imgSina != null) {
            imgSina.setOnClickListener(this);
        }
        if (txtFreeRegister != null) {
            txtFreeRegister.setOnClickListener(this);
        }
    }

    @Override
    public void onClick (View v) {
        int id = v.getId();
        Intent intent;

        switch (id){
            case R.id.load_back_btn:
                finish();
                break;
            case R.id.load_free_register:
                intent = new Intent(this,FreeRegisterActivity.class);
                startActivity(intent);
                finish();
                break;
            case R.id.load_login_btn:
                // TODO 跳转至登录界面
                break;
            case R.id.load_forget_password:
                // 跳转至找回密码界面
                intent = new Intent(this,ForgetPasswordActivity.class);
                startActivity(intent);
                break;
            case R.id.load_etc_login_weixin:
                // TODO 第三方微信登陆
                break;
            case R.id.load_etc_login_qq:
                // TODO 第三方QQ登录
                break;
            case R.id.load_etc_login_sina:
                // TODO 第三方新浪登陆
                break;
        }
    }
}
